﻿#region FileHeader
//////////////////////////////////////////////////////////////////////////////////
// Author:                          Hector Llanos
// Date:                            03.19.2011
// FileName:                        CStandardLaser.cs
// Reason:                          basic laser
//////////////////////////////////////////////////////////////////////////////////
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Base;
using Run_Game;
using Globals;
using MessagingSystem;

namespace Objects
{
    public class CStandardLaser : CBulletBase
    {

        public CStandardLaser()  : base(Game1.Instance.Content, "SpriteSheets/bullet", 5, 1, 10)
        {
            //Type = type.STANDARDLASER;
            Speed = 150f;
        }
        public override void Update(float fElapsedTime)
        {
            Animtion.UpdateFrame(fElapsedTime);
            base.Update(fElapsedTime);

            if (Position.X + Width / 2 > CGlobal.Screenwidth)
                Game1.Instance.MessageSystem.SendMessage(new CDestroyBulletMessage(this));
            if (Position.X < 0)
                Game1.Instance.MessageSystem.SendMessage(new CDestroyBulletMessage(this));

            if (Position.Y < 0)
                Game1.Instance.MessageSystem.SendMessage(new CDestroyBulletMessage(this));

            if (Position.Y + Height / 2 > CGlobal.Screenheight)
                Game1.Instance.MessageSystem.SendMessage(new CDestroyBulletMessage(this));
        }
        public override void Render()
        {
            Animtion.DrawFrame(Game1.Instance.SpriteBatch, Position);
        }
    }
}
